<template>
<el-container>
    <el-aside width="200px">
       <MemberMenu></MemberMenu>
    </el-aside>

<div class="formCss">
  <el-table :data="companyUsers" highlight-current-row @current-change="handleCurrentChange" style="width: 100%">
    <el-table-column label="序号" type="index" width="50"></el-table-column>
    <el-table-column prop="department.name" label="所在部门" width="120"></el-table-column>
    <el-table-column prop="userinfo.name" label="姓名" width="120"></el-table-column>
    <el-table-column prop="position.name" label="职位" width="120"></el-table-column>
    <el-table-column prop="jobIn"   label="入职时间" width="120"></el-table-column>
  </el-table>
</div>
  
</el-container>
</template>

<script>
import MemberMenu from '@/components/menu/MemberMenu.vue'
import instance from '@/utlis/request.js'


export default {
    
    components: {
        MemberMenu,
        
    },
  
    data() {
        
        return {
        companyUsers:[],
        };
    },
    //钩子函数   一般用来初始化数据
    created:function(){
      this.initData();
    },
     methods: {    
      //显示页面所有的职位功能
      initData(){   
        var companyUser=window.sessionStorage.getItem("companyUser");
        var companyUserObj=JSON.parse(companyUser);
        var companyId=companyUserObj.companyId;
        console.log("/////////////////");
        console.log(companyId);
        instance.get("companyUser/positionList/"+companyId).then(res=>{
          this.companyUsers=res.data.data;
        })
      },

    }

}
</script>
<style scoped>
     
    .formCss{
         width: 900px;
         margin-left: 400px;
    }

</style>